package service

import (
	"context"
	"monoblog/common/register"
	"monoblog/domain/dto"
	"monoblog/domain/model"
)

func GetCategoryService() CategoryService {
	return register.GetInstance[CategoryService]("CategoryService")
}

type CategoryService interface {
	Add(ctx context.Context, form dto.CategoryReqForm) (string, error)

	UpdateByID(ctx context.Context, id string, form dto.CategoryReqForm) error

	DeleteByID(ctx context.Context, id string) error

	FindByID(ctx context.Context, id string) (*model.Category, error)

	FindList(ctx context.Context) ([]*model.Category, error)
}
